package yc.star.friend.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import yc.star.common.controller.BaseController;
import yc.star.common.domain.AppResult;
import yc.star.common.file.domain.OSSResult;
import yc.star.friend.service.IFileService;

@RequestMapping("/file")
@RestController
public class FileController extends BaseController {

    @Autowired
    private IFileService fileService;

    @PostMapping("/upload")
    public AppResult<OSSResult> upload (@RequestBody MultipartFile file) {
        return AppResult.success(fileService.upload(file));
    }

}